package cn.edu.yzu.scholarship.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class GlobalConstantInitListener implements ServletContextListener {

	public static final String WEB_ROOT = "webapp.root";

	public void contextDestroyed(ServletContextEvent servletcontextevent) {
		System.getProperties().remove(WEB_ROOT);
	}

	public void contextInitialized(ServletContextEvent servletcontextevent) {
		System.setProperty(WEB_ROOT, servletcontextevent.getServletContext().getRealPath("/"));
	}

}